
from django.contrib.admin.templatetags.adminmedia import *

from django.template.context import Context, RequestContext, ContextPopException
from django.template.loader import get_template, select_template
from django.conf import settings
from django.template import Library

def xadmin_media_url():
    """
    Returns the string contained in the setting ADMIN_MEDIA_PREFIX.
    """
    return settings.XADMIN_MEDIA_URL
xadmin_media_url = register.simple_tag(xadmin_media_url)

#def admin_media_prefix():
#    """
#    Returns the string contained in the setting ADMIN_MEDIA_PREFIX.
#    """
#    return settings.XADMIN_MEDIA_URL
#admin_media_prefix = register.simple_tag(admin_media_prefix)

 

def xadmin_theme():
    """
    Returns the string contained in the setting ADMIN_MEDIA_PREFIX.
    """    
    from xadmin.settings import THEME
    return THEME
xadmin_theme = register.simple_tag(xadmin_theme)


def xadmin_button(label, link, icon=None):
    from xadmin.xbuttons import XModelAdminButton
    return str (XModelAdminButton( label, link, icon ) )

xadmin_button = register.simple_tag(xadmin_button)